import { findHeadCategory } from '@/api/home'
export default {
  namespaced: true,
  state: () => ({
    catelist: []
  }),
  // 同步
  mutations: {
    updateCatelist (state, list) {
      state.catelist = list
    }
  },
  // 异步
  actions: {
    async getCatelist ({ commit }) {
      const { result } = await findHeadCategory()
      // console.log('数据', result)
      commit('updateCatelist', result)
    }
  }
}
